<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>约车看房</title>
    <meta content="yes" name="apple-mobile-web-app-capable"><!-- 这meta的作用就是删除默认的苹果工具栏和菜单栏允许全屏模式浏览-->
    <meta name="apple-touch-fullscreen" content="yes"><!-- 开启对web app程序的支持  -->
    <meta content="telephone=no,email=no" name="format-detection"><!-- iPhone会自动把你这个文字加链接样式、并且点击这个数字还会自动拨号！telephone=no就忽略页面中的数字识别为电话号码 ,email=no 忽略识别邮箱 -->
    <!--base css-->
    <link rel="stylesheet" href="CSS/reset.css"/>
    <link rel="stylesheet" href="CSS/index.css"/>
    <link rel="stylesheet" href="FONT/iconfont.css"/>
    <!--base css end-->
    <!--base js-->
    <meta name="viewport" content="initial-scale=1.0">
    <!--<meta content="yes" name="apple-mobile-web-app-capable">-->
    <script>
        window.scrollTo(0, 0);
    </script>
    <!--<meta content="yes" name="apple-mobile-web-app-capable"> end-->
    <script src="JS/reset.js"></script>
    <script src="JS/jquery.min.js"></script>
    <script src="JS/zepto.min.js"></script>
    <script src="JS/TouchSlide.js"></script>
    <script src="JS/notice.js"></script>
    <script src="JS/screen.js"></script>
    <script src="JS/back.js"></script>
    <!--base js end-->


    <!--no base css-->

    <link href="CSS/mobiscroll.custom-2.5.0.min.css" rel="stylesheet" type="text/css" />
    <style>
        .denglutit input{
            padding-left: 0;
            color: #3c3c3c;
        }
        .yzspan{
            color: #787878;
            float: left;
            margin-right:  0.15625rem;
        }
        .ui-input-text{
            float: left;

        }
        .ui-loader{
            display: none;
        }
    </style>
    <!--no base css end-->
    <!--no js -->
    <script type="text/javascript" src="JS/jquery.mobile-1.3.0.min.js" ></script>
    <script type="text/javascript" src="JS/mobiscroll.js" ></script>
    <script type="text/javascript" src="JS/yuechetan.js" ></script>
    <!--no js end-->

</head>
<body>
<!--wapper-->
<div class="wapper">
    <!--header-->
    <div class="header">
        <div class="header-list bag-1462c4">
            <div class="p-l-25 p-r-25 relative text-center f33">
                <a href="javascript:history.go(-1)" class="block"><i class="icon iconfont f-b">&#xe643;</i></a>
                <a href="{:U('Index/index')}"  data-ajax="false" class="home"><i class="icon iconfont">&#xe61a;</i></a>
                <a href="javascript:;" class="text-fff">约车看房</a>
            </div>
        </div>
    </div>
    <!--header end-->
    <!--content-->
    <div class="content">
        <div class="yuche-list p-l-25 p-r-25">
            <!--yuchediv-->
            <div class="yuchediv m-t-35  m-b-35">
                <?php
                    $time=time();
                    $year =date("Y",$time);
                    $month= date('m',$time);
                    $day = date('d',$time);
                    $wkeys = date('w',$time);
                    $weekarray=array("日","一","二","三","四","五","六");
                    $daynum=[];
                    $wday=[];
                    for($i=0;$i<=6;$i++){
                        $daynum[] = date('d',$time+$i*24*3600);
                        $wday[] = date('w',$time+$i*24*3600);
                    }
                    //中文星期几
                    $weeks=[];
                    for($i=0;$i<=6;$i++){
                        $weeks[]=$weekarray[$wday[$i]];
                    }
              


                ?>
                <ul class="clearFloat">
                 <li>{$year}年</li>
                 <li>{$month}月</li>
                </ul>
            </div>

            <!--yuchediv end-->
            <!--yuchedata-->
            <div class="yuchedata">
                <div class="yuech-cell">
                    {volist name="weeks" id="data"}
                    <span>{$data}</span>
                    {/volist}
                </div>
                <style>
                .yanse{
                   color:#00a31f; 
                }
                </style>

                <div class="yuch-cont">
                {volist name="daynum" id="data"}
                    <div class="yuch-contlist relative display {if condition="$day eq $data"}yucah-active{/if}">
                        <a href="#" class="va">{$data}</a>
                        <span class="yucab {if condition="$day eq $data"}yanse{/if}">约</span>
                    </div>                        
                  
                {/volist}
                </div>
               <input type="hidden" id="time" value="">
        <script>
            $(document).ready(function(){
            //START
            $(".va").click(function(){
                var wtime= $(this).text();
                $('#time').val(wtime);
            });
           
            $(".display").click(function(){
            $(this).toggleClass('yucah-active');
            $('.yucah-active').not(this).removeClass('yucah-active');

            $(this).children(".yucab").toggleClass('yanse');
            $(this).siblings().children('.yucab').removeClass('yanse');
              });
            //END 
                     });
        </script>  
            </div>
            <!--yuchedata end-->
       
            <div class="yuecheinput">
                <div class="dengluinput m-t-33 m-b-33">
                        <div class="denglutit clearFloat">
                            <span class="yzspan">看房楼盘: </span>
                            <input type="text" value="{:session('loupan_name')}" name="loupan" id="loupan" style="width: 75%"/>
                        </div>
                        <div class="denglutit clearFloat">
                            <span class="yzspan">用车时间: </span>
                            <input type="text" value="" style="width: 75%" id="ycdata"/>

                        </div>

                        <script type="text/javascript">
                            $(function () {
                                var opt={};
                                opt.time = {preset:'time'};
                                opt.default = {
                                    theme: 'android-ics light', //皮肤样式
                                    display: 'modal', //显示方式
                                    mode: 'mixed', //日期选择模式
                                    row:"3"
                                };
                                var optTime = $.extend(opt['time'], opt['default']);
                                $("#ycdata").mobiscroll(optTime).time(optTime);
                            });


                        </script>

                        <div class="denglutit clearFloat">
                            <span class="yzspan">上车地点: </span>
                            <input type="text" value="" name="shangche" id="shangche" style="width: 75%"/>
                        </div>
                </div>
                <a href="" class="denglusub">立即约车</a>
            </div>
        </div>
        <script>
            $(document).ready(function(){
                //START
                   $(".denglusub").click(function(){
                    var yongche = $('#ycdata').val();
                    var loupan = $('#loupan').val();
                    var shangche = $('#shangche').val();
                    var time = $('#time').val();
                   $.post("{:U('Index/getche')}",{loupan:loupan,yongchetime:yongche,shangche:shangche,wtime:time},function(data){
                    if(data ==1){
                        $(".yuechetan").show();
                    }else{
                        alert('预约失败');
                    }

                  },'json');
                      }); 

            //END 
                     });
        </script> 

        <!--弹出层-->
        <div class="yuechetan">
            <div class="yuchetancont">
                <img src="images/ycdg.png" alt="" class="ycdg"/>
                <!--<img src="images/yccz.png" alt="" class="yczc"/>-->
                <span class="display-block f40 text-3c3c3c m-t-25">约车成功</span>
            </div>
        </div>


        <!--弹出层 end-->





    </div>

    <!--content end-->
    <!--返回顶部-->
    <a href="#" id="scrollUp" style="position: fixed; z-index: 10;">
        <i class="icon iconfont">&#xe60c;</i>
    </a>
    <!--返回顶部-->


</div>
<!--wapper end-->
</body>
</html>